home *** CD-ROM | disk | FTP | other *** search
- public _copymem
- ;∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
- ; Copy a block of memory to another (possibly overlapping) location
- ; In:
- ; ECX - length of block
- ; ESI -> source
- ; EDI -> destination
- ; Out:
- ;∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
- _copymem:
- push ax
- push ecx
- push esi
- push edi
- cmp esi,edi
- jae short copymemf0
- add esi,ecx
- add edi,ecx
- dec esi
- dec edi
- std
- copymemf0:
- rep movsb
- cld
- pop edi
- pop esi
- pop ecx
- pop ax
- ret
-
-